Telegram Group & Telegram Channel
137. Program to check whether the number is palindrome or not using recursion.

#include<stdio.h>

int checkPalindrome(int);

int main() {

int n, sum;

printf("Enter a number : ");
scanf("%d",&n);

sum = checkPalindrome(n);

if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);

return 0;
}

int checkPalindrome(int n) {

static int sum=0, r;
if(n != 0)
{
r = n % 10;
sum = sum * 10 + r;
checkPalindrome(n/10);
}
return sum;
}
@C_Codings



tg-me.com/C_Codings/199
Create:
Last Update:

137. Program to check whether the number is palindrome or not using recursion.

#include<stdio.h>

int checkPalindrome(int);

int main() {

int n, sum;

printf("Enter a number : ");
scanf("%d",&n);

sum = checkPalindrome(n);

if(n == sum)
printf("%d is a palindrome", n);
else
printf("%d is not a palindrome", n);

return 0;
}

int checkPalindrome(int n) {

static int sum=0, r;
if(n != 0)
{
r = n % 10;
sum = sum * 10 + r;
checkPalindrome(n/10);
}
return sum;
}
@C_Codings

BY C Language πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/C_Codings/199

View MORE
Open in Telegram


C Language ‍ Telegram | DID YOU KNOW?

Date: |

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

To pay the bills, Mr. Durov is issuing investors $1 billion to $1.5 billion of company debt, with the promise of discounted equity if the company eventually goes public, the people briefed on the plans said. He has also announced plans to start selling ads in public Telegram channels as soon as later this year, as well as offering other premium services for businesses and users.

C Language ‍ from kr


Telegram C Language πŸ‘¨β€πŸ’»
FROM USA